<div class="auth-main">
  <div *ngIf="checkPass" class="auth-block">
    <h1>设置密码</h1>

    <form [formGroup]="form" (ngSubmit)="onSubmit()" class="my-validate-form">

      <div class="form-group row">
        <label class="col-sm-2 control-label">新密码</label>
        <div class="col-sm-10">
          <input type="password" class="form-control" name="password" formControlName="password"
                 [(ngModel)]="model.password" #password>
        </div>
      </div>
      <div class="form-group row">
        <label class="col-sm-2 control-label">重复密码</label>
        <div class="col-sm-10">
          <input type="password" class="form-control" name="rePassword" formControlName="rePassword"
                 [(ngModel)]="model.rePassword" #rePassword>
        </div>
      </div>

      <div class="form-group row">
        <label class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
          <button type="submit" class="btn btn-primary btn-auth" [disabled]="!form.valid">保存密码</button>
          <a routerLink="/login" class="forgot-pass">返回登录</a>
        </div>
      </div>
      <div class="form-group row">
        <label class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
          <div class="validate-errors">
            <div class="validate-error" *ngFor="let msg of formErrors">
              <div>{{ msg }}</div>
            </div>
          </div>
        </div>
      </div>
    </form>
  </div>

  <div *ngIf="!checkPass" class="auth-block">
    <h1>{{msg}}</h1>
    <a routerLink="/forgot-password" class="auth-link">点击这里，重新获取！</a>
  </div>
</div>
